import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring-redis.xml")
public class Application {

  @Autowired
  private ApplicationContext ac;

  @Test
  public void getBeans() {
    String[] bs = ac.getBeanDefinitionNames();
    for (int i = 0; i < bs.length; i++) {
      System.out.println(i + ":" + bs[i]);
    }
  }
}
